﻿using Engine;
using Engine.Graphics;
using Game;
using Game.NetWork;
using GameEntitySystem;
using TemplatesDatabase;

namespace Test1
{
    public class ComponentTest1 : ComponentInventoryBase, IUpdateable
    {
        private bool isbuffing = false;

        public BitmapButtonWidget m_test1Button = new BitmapButtonWidget
        {
            Margin = new Vector2(0f, 0f),
            Size = new Vector2(60f, 60f),
            NormalSubtexture = new Subtexture(ContentManager.Get<Texture2D>("Test1/Textures/Setting"), Vector2.Zero, Vector2.One),
            ClickedSubtexture = new Subtexture(ContentManager.Get<Texture2D>("Test1/Textures/Setting_Click"), Vector2.Zero, Vector2.One)
        };

        public LabelWidget m_test1Display = new LabelWidget
        {
            Text = "Loading",
            FontScale = 0.7f,
            IsHitTestVisible = false,
            HorizontalAlignment = WidgetAlignment.Far,
            VerticalAlignment = WidgetAlignment.Far,
            DropShadow = true
        };

        public LabelWidget Buffscreen = new LabelWidget
        {
            Text = "Loading",
            FontScale = 0.5f,
            IsHitTestVisible = false,
            HorizontalAlignment = WidgetAlignment.Near,
            VerticalAlignment = WidgetAlignment.Center,
            DropShadow = true
        };

        public bool DeveloperModeOn;

        public SubsystemGameInfo m_subsystemGameInfo;

        public SubsystemTerrain m_systemTerrain;

        public ComponentPlayer m_componentPlayer;

        private Game.Random random = new Game.Random();

        public bool isaddedbook;

        public SubsystemTime m_subsystemTime;

        public SubsystemPickables m_subsystemPickables;

        public SubsystemNames m_subsystemNames;

        public bool isfirstspawn;

        public bool BS1 = false;

        public bool isMusicPlay = true;

        public bool isAllLowSen = false;

        public SubsystemPlayers m_players;

        public ComponentTask m_componentTask;

        public FCComponentPC m_componentPC;

        public SubsystemFurnitureBlockBehavior m_SubsystemFurnitureBlockBehavior;

        public ComponentFurnitureInventory componentFurnitureInventory;

        public bool isvillageLoading = false;

        public int num_village4 = 0;

        public bool buffscreenIsVisible = true;

        public float m_mp = 1f;

        public int FCMagicLevel = 0;

        public float m_mplevel;

        public float m_Maxmp;

        public float m_sen;

        public bool isLowSen = false;

        public string worldnameN;

        public string worldgravity;

        public string MPlevel1;

        public bool isinCityArea = false;

        public bool isinBloodArea = false;

        public string Areaname;

        public ComponentHealBuffA componentHealBuffA;

        public ComponentAttackUP componentAttackUP;

        public ComponentSpeedUP componentSpeedUP;

        public ComponentNightsight componentNightsight;

        public ComponentBlind componentBlind;

        public ComponentJump componentJump;

        public ComponentDizzy componentDizzy;

        public SubsystemNaturallyBuildings m_subsystemNaturallyBuildings;

        public ComponentSlowDown m_componentSlowdown;

        public SubsystemAudio m_subsystemAudio;

        public Point3 point1;

        public bool ismiddlesen = false;

        public string Areanamesub;

        public UpdateOrder UpdateOrder => UpdateOrder.Default;

        public float MagicPower => m_mp;

        public float MPLevel => m_mplevel;

        public float MaxMagicPower => m_Maxmp;

        public float Sen => m_sen;

        public bool IsSenLow => isLowSen;

        public override void Load(ValuesDictionary valuesDictionary, IdToEntityMap idToEntityMap)
        {
            base.Load(valuesDictionary, idToEntityMap);
            m_systemTerrain = base.Project.FindSubsystem<SubsystemTerrain>(throwOnError: true);
            m_componentPlayer = base.Entity.FindComponent<ComponentPlayer>(throwOnError: true);
            m_subsystemTime = base.Project.FindSubsystem<SubsystemTime>(throwOnError: true);
            m_subsystemAudio = base.Project.FindSubsystem<SubsystemAudio>(throwOnError: true);
            m_subsystemGameInfo = base.Project.FindSubsystem<SubsystemGameInfo>(throwOnError: true);
            m_subsystemPickables = base.Project.FindSubsystem<SubsystemPickables>(throwOnError: true);
            m_subsystemNames = base.Project.FindSubsystem<SubsystemNames>(throwOnError: true);
            m_players = base.Project.FindSubsystem<SubsystemPlayers>(throwOnError: true);
            m_subsystemNaturallyBuildings = base.Project.FindSubsystem<SubsystemNaturallyBuildings>(throwOnError: true);
            m_SubsystemFurnitureBlockBehavior = base.Project.FindSubsystem<SubsystemFurnitureBlockBehavior>(throwOnError: true);
            BS1 = valuesDictionary.GetValue("BS", defaultValue: false);
            isfirstspawn = valuesDictionary.GetValue("isfirstspawn", defaultValue: true);
            isMusicPlay = valuesDictionary.GetValue("isMusicPlay", defaultValue: true);
            componentNightsight = base.Entity.FindComponent<ComponentNightsight>(throwOnError: true);
            componentSpeedUP = base.Entity.FindComponent<ComponentSpeedUP>(throwOnError: true);
            componentHealBuffA = base.Entity.FindComponent<ComponentHealBuffA>(throwOnError: true);
            componentAttackUP = base.Entity.FindComponent<ComponentAttackUP>(throwOnError: true);
            componentBlind = base.Entity.FindComponent<ComponentBlind>(throwOnError: true);
            componentJump = base.Entity.FindComponent<ComponentJump>(throwOnError: true);
            componentDizzy = base.Entity.FindComponent<ComponentDizzy>(throwOnError: true);
            m_componentPC = base.Entity.FindComponent<FCComponentPC>(throwOnError: true);
            m_componentSlowdown = base.Entity.FindComponent<ComponentSlowDown>(throwOnError: true);
            m_componentTask = base.Entity.FindComponent<ComponentTask>(throwOnError: true);
            componentFurnitureInventory = base.Entity.FindComponent<ComponentFurnitureInventory>(throwOnError: true);
            m_componentPlayer.GuiWidget.Children.Find<StackPanelWidget>("MoreContents").Children.Add(m_test1Button);
            m_componentPlayer.GameWidget.Children.Find<CanvasWidget>("Gui").Children.Add(m_test1Display);
            m_componentPlayer.GameWidget.Children.Find<CanvasWidget>("Gui").Children.Add(Buffscreen);
            DeveloperModeOn = valuesDictionary.GetValue("DeveloperModeOn", defaultValue: false);
            m_mp = valuesDictionary.GetValue("MagicPower", 1f);
            m_sen = valuesDictionary.GetValue("Sen", 100f);
            isLowSen = valuesDictionary.GetValue("IsSenLow", defaultValue: false);
            isaddedbook = valuesDictionary.GetValue("book", defaultValue: false);
            m_Maxmp = valuesDictionary.GetValue("MaxMagicPower", 100f);
            m_mplevel = valuesDictionary.GetValue("MPLevel", 10f);
            FCMagicLevel = valuesDictionary.GetValue("FCLevel", 0);
            Areaname = valuesDictionary.GetValue("Areaname", "");
            ismiddlesen = valuesDictionary.GetValue("ismiddelsen", defaultValue: false);
        }

        public override void Save(ValuesDictionary valuesDictionary, EntityToIdMap entityToIdMap)
        {
            base.Save(valuesDictionary, entityToIdMap);
            valuesDictionary.SetValue("DeveloperModeOn", DeveloperModeOn);
            valuesDictionary.SetValue("MagicPower", m_mp);
            valuesDictionary.SetValue("Sen", Sen);
            valuesDictionary.SetValue("IsSenLow", IsSenLow);
            valuesDictionary.SetValue("book", isaddedbook);
            valuesDictionary.SetValue("isfirstspawn", isfirstspawn);
            valuesDictionary.SetValue("ismiddelsen", ismiddlesen);
            valuesDictionary.SetValue("isMusicPlay", isMusicPlay);
            valuesDictionary.SetValue("MaxMagicPower", MaxMagicPower);
            valuesDictionary.SetValue("MPLevel", m_mplevel);
            valuesDictionary.SetValue("FCLevel", FCMagicLevel);
            valuesDictionary.SetValue("Areaname", Areaname);
        }

        public override void OnEntityRemoved()
        {
            base.OnEntityRemoved();
            m_componentPlayer.GuiWidget.Children.Find<StackPanelWidget>("MoreContents").Children.Remove(m_test1Button);
            m_componentPlayer.GameWidget.Children.Find<CanvasWidget>("Gui").Children.Remove(m_test1Display);
            m_componentPlayer.GameWidget.Children.Find<CanvasWidget>("Gui").Children.Remove(Buffscreen);
        }

        public override void OnEntityAdded()
        {
            ComponentPlayer componentPlayer = base.Entity.FindComponent<ComponentPlayer>();
            if (componentPlayer != null)
            {
                if (IsSenLow)
                {
                    base.Project.FindSubsystem<SubsystemBlocksTexture>(throwOnError: true).BlocksTexture = ContentManager.Get<Texture2D>("BlocksSen");
                }

                if (isfirstspawn)
                {
                    FCModLoaderShengcheng.AddItem(componentPlayer.ComponentMiner, m_subsystemPickables, 328667, 1);
                    SubsystemNaturallyBuildings.InitFurnitureDesign(m_SubsystemFurnitureBlockBehavior, componentFurnitureInventory);
                    isfirstspawn = false;
                    CommonLib.Net.QueuePackage(new ComponentTest1Package(this, ComponentTest1Package.EventType.SyncStat2, isfirstspawn));
                }
            }

            base.OnEntityAdded();
        }

        public static int GetTemperatureAdjustmentAtHeight(int y)
        {
            return (int)MathUtils.Round((y > 64) ? (-0.0008f * (float)MathUtils.Sqr(y - 64)) : (0.1f * (float)(64 - y)));
        }

        public void UpdateLevel()
        {
            m_subsystemAudio.PlaySound("Audio/LevelUp", 1f, 0f, 0f, 0.1f);
            if (m_Maxmp < 1000f)
            {
                m_Maxmp = 1000f;
                FCMagicLevel = 1;
            }
            else if (m_Maxmp < 5000f)
            {
                m_Maxmp = 5000f;
                FCMagicLevel = 2;
            }
            else if (m_Maxmp < 10000f)
            {
                m_Maxmp = 10000f;
                FCMagicLevel = 3;
            }
            else if (m_Maxmp < 50000f)
            {
                m_Maxmp = 50000f;
                FCMagicLevel = 4;
            }
            else if (m_Maxmp < 100000f)
            {
                m_Maxmp = 100000f;
                FCMagicLevel = 5;
            }
            else if (m_Maxmp < 1098888f)
            {
                m_Maxmp = 1098888f;
                FCMagicLevel = 6;
            }

            if (CommonLib.WorkType != WorkType.Client)
            {
                CommonLib.Net.QueuePackage(new ComponentTest1Package(this, ComponentTest1Package.EventType.SyncMagic, FCMagicLevel));
            }
        }

        public float CalculateLevelnum(int level, float levelnum)
        {
            float result = 0f;
            switch (level)
            {
                case 0:
                    result = 100f - levelnum;
                    MPlevel1 = "灵感者";
                    break;
                case 1:
                    result = 5000f - levelnum;
                    MPlevel1 = "一级通灵师";
                    break;
                case 2:
                    result = 10000f - levelnum;
                    MPlevel1 = "二级通灵师";
                    break;
                case 3:
                    result = 20000f - levelnum;
                    MPlevel1 = "三级通灵师";
                    break;
                case 4:
                    result = 50000f - levelnum;
                    MPlevel1 = "灵王";
                    break;
                case 5:
                    result = 100000f - levelnum;
                    MPlevel1 = "灵王";
                    break;
                case 6:
                    result = 1f;
                    MPlevel1 = "通灵之神";
                    break;
            }

            return result;
        }

        public string GetLevelname(int level)
        {
            switch (level)
            {
                case 0:
                    MPlevel1 = "灵感者";
                    break;
                case 1:
                    MPlevel1 = "一级通灵师";
                    break;
                case 2:
                    MPlevel1 = "二级通灵师";
                    break;
                case 3:
                    MPlevel1 = "三级通灵师";
                    break;
                case 4:
                    MPlevel1 = "灵王";
                    break;
                case 5:
                    MPlevel1 = "灵祖";
                    break;
                case 6:
                    MPlevel1 = "通灵之神";
                    break;
            }

            return MPlevel1;
        }

        public void UpdateAllChunks(float time, TerrainChunkState chunkState)
        {
            if (time == 0f)
            {
                m_systemTerrain.TerrainUpdater.DowngradeAllChunksState(chunkState, forceGeometryRegeneration: true);
            }

            Time.QueueTimeDelayedExecution(Time.RealTime + (double)time, delegate
            {
                m_systemTerrain.TerrainUpdater.DowngradeAllChunksState(chunkState, forceGeometryRegeneration: true);
            });
        }

        public void Update(float dt)
        {
            if (CommonLib.WorkType != WorkType.Client && Time.PeriodicEvent(2.0, 0.0))
            {
                if (m_mp < 0f)
                {
                    m_mp = 0f;
                }
                else if (m_mp > 1f)
                {
                    m_mp = 1f;
                }

                CommonLib.Net.QueuePackage(new ComponentTest1Package(this, ComponentTest1Package.EventType.SyncMagic, FCMagicLevel));
            }

            if (FCMagicLevel < 6)
            {
                if (MathUtils.Floor(m_componentPlayer.PlayerData.Level) >= 15f && FCMagicLevel == 0)
                {
                    UpdateLevel();
                }
                else if (MathUtils.Floor(m_componentPlayer.PlayerData.Level) >= 25f && FCMagicLevel == 1)
                {
                    UpdateLevel();
                }
                else if (MathUtils.Floor(m_componentPlayer.PlayerData.Level) >= 35f && FCMagicLevel == 2)
                {
                    UpdateLevel();
                }
                else if (MathUtils.Floor(m_componentPlayer.PlayerData.Level) >= 70f && FCMagicLevel == 3)
                {
                    UpdateLevel();
                }
                else if (MathUtils.Floor(m_componentPlayer.PlayerData.Level) >= 140f && FCMagicLevel == 4)
                {
                    UpdateLevel();
                }
                else if (MathUtils.Floor(m_componentPlayer.PlayerData.Level) >= 999f && FCMagicLevel == 5)
                {
                    UpdateLevel();
                }
            }

            if (MathUtils.Floor(m_componentPlayer.PlayerData.Level) < 7f)
            {
                MPlevel1 = "你的等级小于7，无法使用灵能功能！";
            }
            else
            {
                MPlevel1 = GetLevelname(FCMagicLevel);
            }

            if (MathUtils.Floor(m_componentPlayer.PlayerData.Level) >= 7f && Time.PeriodicEvent(2.0, 0.0))
            {
                if (m_componentPlayer.ComponentVitalStats.Sleep < 0.8f)
                {
                    m_componentPlayer.ComponentVitalStats.Sleep += 0.05f;
                }

                m_componentPlayer.ComponentVitalStats.Stamina += 0.3f;
            }

            point1 = Terrain.ToCell(m_componentPlayer.ComponentBody.Position);
            Point2 coord = (point1.X / 16, point1.Z / 16);
            if (CommonLib.WorkType != WorkType.Client && Time.PeriodicEvent(2.0, 0.0))
            {
                if (m_sen > 100f)
                {
                    m_sen = 100f;
                }
                else if (m_sen < 0f)
                {
                    m_sen = 0f;
                }

                CommonLib.Net.QueuePackage(new ComponentTest1Package(this, ComponentTest1Package.EventType.SyncStat));
            }

            if (m_sen < 30f && !ismiddlesen)
            {
                m_componentPlayer.ComponentGui.DisplayLargeMessage("Sen值过低！请立刻恢复Sen值！", null, 1.5f, 0f);
                ismiddlesen = true;
            }
            else if (m_sen >= 30f)
            {
                ismiddlesen = false;
            }

            if (m_sen < 20f)
            {
                isLowSen = true;
            }
            else
            {
                isLowSen = false;
            }

            if (Time.PeriodicEvent(10.0, 0.0))
            {
                int num = 0;
                int count = m_players.ComponentPlayers.Count;
                foreach (ComponentPlayer componentPlayer in m_players.ComponentPlayers)
                {
                    if (componentPlayer != null)
                    {
                        ComponentTest1 componentTest = componentPlayer.Entity.FindComponent<ComponentTest1>();
                        if (componentTest.isLowSen)
                        {
                            num++;
                        }
                    }
                }

                if (num == count)
                {
                    isAllLowSen = true;
                    m_componentPlayer.ComponentGui.DisplayLargeMessage($"警告!{num}名玩家全部进入低sen，即将触发世界扭曲！", null, 3f, 0f);
                }
                else if (num < count && num != 0)
                {
                    isAllLowSen = false;
                    m_componentPlayer.ComponentGui.DisplayLargeMessage($"当前已经有{num}名玩家进入低sen状态！", null, 1f, 0f);
                }
                else
                {
                    isAllLowSen = false;
                }
            }

            if (CommonLib.WorkType != WorkType.Client)
            {
                if (base.Project.FindSubsystem<SubsystemBlocksTexture>(throwOnError: true).BlocksTexture == BlocksTexturesManager.DefaultBlocksTexture)
                {
                    if (isAllLowSen)
                    {
                        m_componentPlayer.ComponentGui.DisplayLargeMessage("全员低Sen状态！！！祇看到你们了……", null, 3f, 0f);
                        CommonLib.Net.QueuePackage(new ComponentTest1Package(this, ComponentTest1Package.EventType.TurnToLowSen));
                        base.Project.FindSubsystem<SubsystemBlocksTexture>(throwOnError: true).BlocksTexture = ContentManager.Get<Texture2D>("BlocksSen");
                        UpdateAllChunks(0f, TerrainChunkState.InvalidLight);
                    }
                }
                else if (base.Project.FindSubsystem<SubsystemBlocksTexture>(throwOnError: true).BlocksTexture == ContentManager.Get<Texture2D>("BlocksSen") && !isAllLowSen)
                {
                    m_componentPlayer.ComponentGui.DisplayLargeMessage("成功脱离低Sen！", null, 1.5f, 0f);
                    CommonLib.Net.QueuePackage(new ComponentTest1Package(this, ComponentTest1Package.EventType.TurnToHighSen));
                    base.Project.FindSubsystem<SubsystemBlocksTexture>(throwOnError: true).BlocksTexture = BlocksTexturesManager.DefaultBlocksTexture;
                    UpdateAllChunks(0f, TerrainChunkState.InvalidLight);
                }
            }

            foreach (BuildingInfo buildingInfo in m_subsystemNaturallyBuildings.BuildingInfos)
            {
                if (buildingInfo == null)
                {
                    continue;
                }

                if (buildingInfo.CalculatPlainRange(coord))
                {
                    if (buildingInfo.Name == "House/Supercity" && !isinCityArea)
                    {
                        string largeText = "你已经进入了[失落城市]区域！失落城市内sen值无法自动回复！\n小心游荡的怪物们！";
                        m_componentPlayer.ComponentGui.DisplayLargeMessage(largeText, null, 2f, 0f);
                        Areaname = "失落城市";
                        isinCityArea = true;
                    }
                    else if (buildingInfo.Name == "House/血泪" && !isinBloodArea)
                    {
                        string largeText2 = "你已经进入了[血泪之池]区域！小心游荡的怪物！";
                        m_componentPlayer.ComponentGui.DisplayLargeMessage(largeText2, null, 2f, 0f);
                        m_componentTask.BloodPool = true;
                        Areaname = "血泪之池";
                        isinBloodArea = true;
                    }
                }
                else if (buildingInfo.Name == "House/Supercity" && isinCityArea)
                {
                    string largeText3 = "你已经离开了[失落城市]区域！";
                    m_componentPlayer.ComponentGui.DisplayLargeMessage(largeText3, null, 2f, 0.1f);
                    Areaname = "";
                    isinCityArea = false;
                }
                else if (buildingInfo.Name == "House/血泪" && isinBloodArea)
                {
                    string largeText4 = "你已经离开了[血泪之池]区域！";
                    m_componentPlayer.ComponentGui.DisplayLargeMessage(largeText4, null, 2f, 0.1f);
                    Areaname = "";
                    isinBloodArea = false;
                }
            }

            if (point1.X > 3425 && point1.X < 3517 && point1.Z > 3168 && point1.Z < 3273 && point1.Y > 64)
            {
                Areanamesub = "[隐士居所]";
            }
            else if (point1.X > 3072 && point1.X < 3197 && point1.Z > 3072 && point1.Z < 3212 && point1.Y > 64)
            {
                Areanamesub = "[安全区]";
            }
            else if (point1.X > 3149 && point1.X < 3186 && point1.Z > 3415 && point1.Z < 3490 && point1.Y > 64)
            {
                Areanamesub = "[墓园]";
            }
            else
            {
                Areanamesub = "";
            }

            if (DeveloperModeOn)
            {
                m_test1Display.IsVisible = true;
                Point3 point = Terrain.ToCell(m_componentPlayer.ComponentBody.Position);
                int num2 = m_systemTerrain.Terrain.GetTemperature(point.X, point.Z) + GetTemperatureAdjustmentAtHeight(point.Y);
                int humidity = m_systemTerrain.Terrain.GetHumidity(point.X, point.Z);
                string text = $"温度={num2},湿度={humidity},坐标 = {point}";
                int activeBlockValue = m_componentPlayer.ComponentMiner.ActiveBlockValue;
                int num3 = Terrain.ExtractContents(activeBlockValue);
                int num4 = Terrain.ExtractData(activeBlockValue);
                string text2 = ((num4 == 0) ? string.Empty : (":" + num4));
                string text3 = BlocksManager.Blocks[num3].GetType().Name + text2;
                string text4 = BlocksManager.Blocks[num3].CraftingId + text2;
                string text5 = $"完整值={activeBlockValue},id={num3},data={num4},\nTypeName={text3},\nCraftingId={text4}";
                m_test1Display.Text = text + "\n" + text5;
            }
            else
            {
                m_test1Display.IsVisible = false;
            }

            if (m_test1Button.IsClicked)
            {
                m_componentPlayer.ComponentGui.ModalPanelWidget = new Test1ButtonsPanelWidget(this);
            }

            if (!buffscreenIsVisible)
            {
                return;
            }

            Buffscreen.IsVisible = true;
            string text6 = "状态栏";
            string text7 = $"当前世界:{worldnameN} [重力:{worldgravity}] [氧气:{(int)(m_componentPlayer.ComponentHealth.Air * m_componentPlayer.ComponentHealth.AirCapacity)}/{(int)m_componentPlayer.ComponentHealth.AirCapacity}]";
            text6 = text6 + "\n" + text7;
            string text8 = $"当前区域:{Areaname}{Areanamesub}";
            text6 = text6 + "\n" + text8;
            string text9 = $"当前生命:{(int)(m_componentPlayer.ComponentHealth.Health * m_componentPlayer.ComponentHealth.AttackResilience)}/{(int)m_componentPlayer.ComponentHealth.AttackResilience}";
            text6 = text6 + "\n" + text9;
            string text10 = $"当前攻击力:{(int)m_componentPlayer.ComponentMiner.AttackPower}";
            text6 = text6 + "\n" + text10;
            string text11 = $"当前速度:{(int)m_componentPlayer.ComponentLocomotion.WalkSpeed}";
            text6 = text6 + "\n" + text11;
            string text12 = $"护盾值:{(int)(MagicPower * MaxMagicPower)}/{(int)MaxMagicPower}[{MPlevel1}]";
            text6 = text6 + "\n" + text12;
            string text13 = $"当前sen值:{(int)Sen}";
            text6 = text6 + "\n" + text13;
            if (componentHealBuffA.m_HealDuration > 0f || componentAttackUP.m_ATKDuration > 0f || componentSpeedUP.m_SpeedDuration > 0f || componentNightsight.m_NightseeDuration > 0f || componentBlind.m_BlindDuration > 0f || m_componentSlowdown.m_SlowDuration > 0f || componentJump.m_JumpDuration > 0f || componentDizzy.m_DizzyDuration > 0f)
            {
                isbuffing = true;
            }
            else
            {
                isbuffing = false;
            }

            if (isbuffing)
            {
                if (componentHealBuffA.m_HealDuration > 0f)
                {
                    string text14 = $"生命恢复：{(int)componentHealBuffA.m_HealDuration}s,速率：{(int)componentHealBuffA.m_HealRate}血每秒";
                    text6 = text6 + "\n" + text14;
                }

                if (componentAttackUP.m_ATKDuration > 0f)
                {
                    string text15 = $"攻击力强化：{(int)componentAttackUP.m_ATKDuration}s,原攻击力：{(int)componentAttackUP.ATK_first}";
                    text6 = text6 + "\n" + text15;
                }

                if (componentSpeedUP.m_SpeedDuration > 0f)
                {
                    string text16 = $"速度强化：{(int)componentSpeedUP.m_SpeedDuration}s,原速度：{(int)componentSpeedUP.Speed_first}";
                    text6 = text6 + "\n" + text16;
                }

                if (componentNightsight.m_NightseeDuration > 0f)
                {
                    string text17 = $"夜视：{(int)componentNightsight.m_NightseeDuration}s";
                    text6 = text6 + "\n" + text17;
                }

                if (componentBlind.m_BlindDuration > 0f)
                {
                    string text18 = $"致盲：{(int)componentBlind.m_BlindDuration}s";
                    text6 = text6 + "\n" + text18;
                }

                if (m_componentSlowdown.m_SlowDuration > 0f)
                {
                    string text19 = $"迟缓：{(int)m_componentSlowdown.m_SlowDuration}s";
                    text6 = text6 + "\n" + text19;
                }

                if (componentDizzy.m_DizzyDuration > 0f)
                {
                    string text20 = $"眩晕：{(int)componentDizzy.m_DizzyDuration}s";
                    text6 = text6 + "\n" + text20;
                }

                if (componentJump.m_JumpDuration > 0f)
                {
                    string text21 = $"跳跃强化：{(int)componentJump.m_JumpDuration}s";
                    text6 = text6 + "\n" + text21;
                }
            }

            Buffscreen.Text = text6;
        }
    }
}